import os
import openai
from pathlib import Path
from dotenv import load_dotenv

load_dotenv(verbose=True)
openai.organization = os.getenv("OPENAI_API_ORGANIZATION")
openai.api_key = os.getenv("OPENAI_API_KEY")

# 设置代理
openai.proxy="http://127.0.0.1:8001"

def completionCreate(prompt):
    response = openai.Completion.create(
    model="text-davinci-003",
    prompt=prompt,
    max_tokens=2560
    )
    return response